/* 
 * Copyright 2005 - 2009 Terracotta, Inc. 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
 * use this file except in compliance with the License. You may obtain a copy 
 * of the License at 
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0 
 *   
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
 * License for the specific language governing permissions and limitations 
 * under the License.
 * 
 */

package org.go.examples.example_03;

import java.util.Date;
import java.util.List;

import org.go.Go;
import org.go.GoContext;
import org.go.expcetion.GoException;
import org.go.expcetion.WorkExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * <p>
 * This is just a simple job that says "Hello" to the world.
 * </p>
 * 
 * @author Bill Kratzer
 */
public class HelloJob implements Go {

	private static Logger _log = LoggerFactory.getLogger(HelloJob.class);

	/**
	 * <p>
	 * Empty constructor for job initilization
	 * </p>
	 * <p>
	 * Quartz requires a public empty constructor so that the
	 * scheduler can instantiate the class whenever it needs.
	 * </p>
	 */
	public HelloJob() {
	}

	/**
	 * <p>
	 * Called by the <code>{@link org.go.quartz.Scheduler}</code> when a
	 * <code>{@link org.quartz.Trigger}</code> fires that is associated with
	 * the <code>Job</code>.
	 * </p>
	 * 
	 * @throws WorkExecutionException
	 *             if there is an exception while executing the job.
	 */
	@Override
	public Boolean doWork(GoContext context) throws WorkExecutionException {
		//System.out.println("hello");
		// Say Hello to the World and display the date/time
		_log.info("Hello World! - " + new Date());
		return null;
	}

	@Override
	public List selectWork(String taskParameter, String ownSign, int taskItemNum, List workParamList, int eachFetchDataNum) throws GoException {
		// TODO Auto-generated method stub
		return null;
	}
}
